import request from '@/utils/request'

// 查询订单列表
export function listOrder(query) {
  return request({
    url: '/module/order/list',
    method: 'get',
    params: query
  })
}

// 查询订单列表
export function listPointsOrder(query) {
  return request({
    url: '/module/order/pointsOrderlist',
    method: 'get',
    params: query
  })
}

// 查询订单列表
export function listOrderStatistics(query) {
  return request({
    url: '/module/order/statistics/list',
    method: 'get',
    params: query
  })
}


// 查询订单列表
export function listMerOrder(query) {
  return request({
    url: '/module/order/mer/list',
    method: 'get',
    params: query
  })
}


// 查询订单列表
export function productEchart(query) {
  return request({
    url: '/module/order/restaurant/product/echart',
    method: 'get',
    params: query
  })
}

// 查询订单列表
export function beverageExport(query) {
  return request({
    url: '/module/order/restaurant/product/beverageExport',
    method: 'get',
    params: query
  })
}




export function listByFenrun(query) {
  return request({
    url: '/module/order/listByFenrun',
    method: 'get',
    params: query
  })
}

// 查询订单详细
export function getOrder(id) {
  return request({
    url: '/module/order/' + id,
    method: 'get'
  })
}

// 查询订单详细
export function getMerOrder(id) {
  return request({
    url: '/module/order/mer/' + id,
    method: 'get'
  })
}

export function updateMerOrder(id) {
  return request({
    url: '/module/order/updateMer/' + id,
    method: 'put'
  })
}
// 新增订单
export function addOrder(data) {
  return request({
    url: '/module/order',
    method: 'post',
    data
  })
}

// 修改订单
export function updateOrder(data) {
  return request({
    url: '/module/order',
    method: 'put',
    data
  })
}

export function updateVipOrder(data) {
  return request({
    url: '/module/order/vip',
    method: 'put',
    data
  })
}

export function restaurantSettleOrder(data) {
  return request({
    url: '/module/order/restaurant/settle',
    method: 'put',
    data
  })
}

export function changeTable(data) {
  return request({
    url: '/module/order/changeTable',
    method: 'put',
    data
  })
}


// 订单退款
export function refundOrder(data) {
  return request({
    url: '/module/order/refund',
    method: 'put',
    data
  })
}


// 删除订单
export function delOrder(id) {
  return request({
    url: '/module/order/' + id,
    method: 'delete'
  })
}

// 核销订单
export function verifyOrder(id) {
  return request({
    url: '/module/order/verify/' + id,
    method: 'post'
  })
}


// 核销订单
export function settlementOrder(id) {
  return request({
    url: '/module/order/settlement/' + id,
    method: 'post'
  })
}


// 导出订单
export function exportOrderTotal(query) {
  return request({
    url: '/module/order/exportTotal',
    method: 'get',
    params: query
  })
}


// 导出订单
export function exportOrderMerTotal(query) {
  return request({
    url: '/module/order/exportMerTotal',
    method: 'get',
    params: query
  })
}


// 导出订单
export function exportOrderMerDetail(query) {
  return request({
    url: '/module/order/exportMerDetail',
    method: 'get',
    params: query
  })
}

// 导出订单
export function exportOrder(query) {
  return request({
    url: '/module/order/export',
    method: 'get',
    params: query
  })
}

